package com.huike.game.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;

import androidx.annotation.Nullable;

@SuppressLint("AppCompatCustomView")
public class marqueeText extends TextView {
    public marqueeText(Context context) {
        this(context,null);
    }

    public marqueeText(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,-1);
    }

    public marqueeText(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setAttr();
    }


    @Override
    public boolean isFocused() {
        return  true;//获取焦点
    }

    public void setAttr(){
        this.setEllipsize(TextUtils.TruncateAt.MARQUEE);
        this.setSingleLine(true);
        this.setMarqueeRepeatLimit(-1);
    }

}
